﻿//双击事件
function CustomDbClick() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    if (record.getData("IsFinish") == 'Y') {
        alert("您的问卷已经提交，有疑问请联系管理员");
        return;
    }

    document.getElementById("EditUIWindow3").src = "../TR/QuestionnaireOnline.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID);
    YAHOO.example.container.dialog5.show();
}
//预览
var fnYulan = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var uid = record.getData("UserID");
    document.getElementById("EditUIWindow3").src = "../TR/QSView.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&QID=" + record.getData(const_entityID) + "&uid=" + uid;
    YAHOO.example.container.dialog5.show();
}

//在线考试
var fnOnline = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    if (record.getData("IsFinish") == 'Y') {
        alert("您的问卷已经提交，有疑问请联系管理员");
        return;
    }
    var url = "../TR/QuestionnaireOnline.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID);
//    document.getElementById("EditUIWindow3").src = url;
//    YAHOO.example.container.dialog5.show();

    var pagetitle = "问卷调研_" + record._oData["QuestionnaireName"];
    var deptName = record._oData["DeptName"];
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI(url));
    parent.NeedRefreshPage = this;

}
//关闭弹出窗体
function closeD5() {
    YAHOO.example.container.dialog5.cancel();
    LoadData();
}